package com.songcha.module_bookreader.module;

import com.songcha.module_bookreader.api.BookApi;
import com.songcha.library_network.api.BaseInterceptor;
import com.songcha.library_network.api.RetrofitClient;

//import dagger.Module;
//import dagger.Provides;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import okhttp3.OkHttpClient;

/*@Module
public class BookApiModule {

    private static BookApi api;

    public BookApiModule(){
        if(api==null)
            api=RetrofitClient.createApi("https://dict.youdao.com", BookApi.class, new Function1<OkHttpClient.Builder, Unit>() {
                @Override
                public Unit invoke(OkHttpClient.Builder builder) {
                    builder.addInterceptor(new BaseInterceptor());
                    return Unit.INSTANCE;
                }
            });
    }

    @Provides
    public BookApi provideBookApi() {
        return api;
    }
}*/
